package com.jsu.hotelmanagement.dao;

import com.jsu.hotelmanagement.observerModel.observer.RoomObserver;
import com.jsu.hotelmanagement.pojo.dto.CheckInOutTimeDTO;
import com.jsu.hotelmanagement.pojo.dto.RoomDetailInfoDTO;
import com.jsu.hotelmanagement.pojo.dto.RoomStatisticsStatusDTO;
import com.jsu.hotelmanagement.pojo.dto.RoomUserRelationDTO;
import com.jsu.hotelmanagement.pojo.po.OrdersInfoVO;
import com.jsu.hotelmanagement.pojo.vo.OrderUserInfoVO;
import com.jsu.hotelmanagement.pojo.vo.RoomGuestInfoVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * @author Mo
 * @createTime 2022/12/7 11:44
 * @description
 */
@Mapper
public interface RoomDao {
    List<RoomStatisticsStatusDTO> queryRoomStatistics();
    List<RoomDetailInfoDTO> queryRoomDetailInfoList();
    RoomUserRelationDTO queryRoomUserRelation(Integer roomId);
    int updateUserRoomStatusCheckout(RoomUserRelationDTO relationDTO);

    /**
     * 将room_guest_info表中当前用户居住房间的using修改为0
     * @param roomUserRelationDTO
     * @return
     */
    int updateRoomGuestHistories(RoomUserRelationDTO roomUserRelationDTO);

    /**
     * 更新房间状态
     * @param roomId
     * @param statusId
     * @return
     */
    int updateRoomStatus(@Param("roomId") Integer roomId, @Param("statusId") Integer statusId);

    /**
     * 查询该房间号的订单状态
     * @param roomId
     * @return
     */
    Integer queryOrderStatus(Integer roomId);

    Integer cancelOrder(Integer roomId);

    List<OrderUserInfoVO> queryOrderUserInfo(Integer roomId);

    int insertOrdersInfo(@Param("ordersInfoVO") OrdersInfoVO ordersInfoVO);

    Date queryEndTime(Integer roomId);

    List<RoomGuestInfoVO> queryRoomGuestInfo(Integer roomId);

    CheckInOutTimeDTO queryCheckInOutTime(Integer roomId);

    int addUser(@Param("userInfoList") List<RoomGuestInfoVO> userInfoList);

    int insertRoomGuestInfo(@Param("userInfoList") List<RoomGuestInfoVO> userInfoList, @Param("roomId") Integer roomId);

    List<RoomObserver> queryOrderInfo();
}


